#!/bin/sh
# This regression test is a part of SIPp.
# A response whose Via has a branch longer than MAX_HEADER_LEN is read
# without overflowing the buffer its branch is copied to.
. "`dirname "$0"`/../functions"; init

{ echo SEQUENTIAL; printf "%010000d\n" 0; } > branch.csv

sippbg -sf uas.xml -i 127.0.0.1 -p 27420 -m 1 -timeout 4
sippfg -sf uac.xml -inf branch.csv -i 127.0.0.1 -p 27421 -m 1 \
    127.0.0.1:27420 -timeout 4 >/dev/null 2>&1
status=$?
wait
rm -f branch.csv

if test $status -ne 0; then
    fail "exit status $status"
else
    ok
fi
